import request from '@/utils/request'

// 创建仓库计算记录
export function addStockQuant(data) {
  return request({
    url: '/stock/quant/create',
    method: 'post',
    data: data
  })
}

// 更新仓库计算记录
export function updateStockQuant(data) {
  return request({
    url: '/stock/quant/update',
    method: 'put',
    data: data
  })
}

// 删除仓库计算记录
export function delStockQuant(id) {
  return request({
    url: '/stock/quant/delete?id=' + id,
    method: 'delete'
  })
}

// 获得仓库计算记录
export function getQuant(id) {
  return request({
    url: '/stock/quant/get?id=' + id,
    method: 'get'
  })
}

// 获得仓库计算记录分页
export function getstockQuantPage(query) {
  return request({
    url: '/stock/quant/page',
    method: 'get',
    params: query
  })
}

// 获得仓库计算记录分页(在产品页面)
export function getQuantPageInProductPage(query) {
  return request({
    url: '/stock/quant/quantPage',
    method: 'get',
    params: query
  })
}

// 导出仓库计算记录 Excel
export function exportStockQuant(query) {
  return request({
    url: '/stock/quant/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
